package legumes.client.services.callbacks;

import java.util.List;

import legumes.client.services.LegumesServicesHelper;
import legumes.client.services.util.rpc.SequencableRPCCall;
import legumes.shared.domain.CustomerDTO;

public class GetCustomersCallback extends SequencableRPCCall<List<CustomerDTO>> {

	private List<CustomerDTO> customers;

	@Override
	protected void doCall() {
		LegumesServicesHelper.LEGUMES_SERVICES.getCustomers(this);
	}

	@Override
	public void onSuccess(List<CustomerDTO> result_) {
		customers = result_;
		callNext();
	}

	public List<CustomerDTO> getCustomers() {
		return customers;
	}

}